package com.supermap.application.dao;

import com.supermap.application.entity.TEnterpriseProfile;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EnterpriseProfileDao  extends JpaRepository<TEnterpriseProfile,String> {

    //根据企业名称获取企业信息
    @Query("select t from TEnterpriseProfile t where t.a00002 like :name")
    List<TEnterpriseProfile> findLikeByName(@Param("name") String name);


    //根据企业名称获取企业信息
    @Query("select t from TEnterpriseProfile t where t.a00002 = :name")
    TEnterpriseProfile findByName(@Param("name") String name);

    //根据组织机构代码获取企业信息
    @Query("select t from TEnterpriseProfile t where t.b101 = :code")
    TEnterpriseProfile findByCode(@Param("code") String code);

    //根据统一社会信用代码获取企业信息
    @Query("select t from TEnterpriseProfile t where t.b00001 = :uniscid")
    TEnterpriseProfile findByUniscid(@Param("uniscid") String uniscid);
}
